package com.example.patient.jpa;

import com.example.common.entity.ClientPatientsInfo;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * @Author wxy
 * @Date 2021/1/19 20:38
 * @Version 1.0
 */
public interface ClientPatientsInfoRepository extends JpaRepository<ClientPatientsInfo, Long> {

    ClientPatientsInfo findFirstByClientIDAndDefaultBitAndDisable(Long clientID, Boolean defaultBit, Boolean disable);

    ClientPatientsInfo findFirstByClientIDAndDefaultBit(Long clientID, Boolean defaultBit);

    Long countByIdNoAndClientIDAndDisable(String idNo, Long pid, Boolean disable);

    int countByIdNoAndClientIDAndDisableAndPidNot(String idNo, Long uid, Boolean disable, Long pid);
}
